﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Jwell.Template.App.MyWindow
{
    public class SolutionOption
    {
        /// <summary>
        /// 项目.Net Framework版本
        /// </summary>
        public string TargetFrameworkVersion { get; set; }

        /// <summary>
        /// 顶级命名空间
        /// </summary>
        public string RootNameSpace { get; set; }

        /// <summary>
        /// 解决方案的路径
        /// </summary>
        public string SolutionPath { get; set; }

        public string SolutionName { get; set; }



        /// <summary>
        /// 表示Solution选项中的Framework版本
        /// </summary>
        public static IList<string> FrameworkVersions;
        static SolutionOption()
        {
            FrameworkVersions = new List<string>();
            foreach (string name in Enum.GetNames(typeof(TargetFrameworkVersionEnum)))
            {
                var attr = typeof(TargetFrameworkVersionEnum).GetField(name).GetCustomAttribute(typeof(DescriptionAttribute)) as DescriptionAttribute;
                if (attr != null)
                    FrameworkVersions.Add(attr.Description);
            }
        }

    }

    /// <summary>
    /// .Net Framework版本枚举,Description切勿动
    /// </summary>
    public enum TargetFrameworkVersionEnum
    {
        /// <summary>
        /// .Net Framework 4.6.1
        /// </summary>
        [Description("v4.6.1")]
        Net461=10,

        /// <summary>
        /// .Net Framework 4.6.2
        /// </summary>
        [Description("v4.6.2")]
        Net462=20
    }
}
